#ifndef CONNECTOR_H_
#define CONNECTOR_H_

#include "Component.h"

class Component;
class Via;

enum Orientation{
	NORTH,
	SOUTH,
	WEST,
	EAST,
	NONE
};

/**
 * Clase que permite la conexion entre dos componentes
 */
class Connector {

private:
	Via* m_via;
	Component* m_father;
	bool m_isEntry;
	unsigned m_xRel;
	unsigned m_yRel;
	enum Orientation m_orientation;
	unsigned int m_idConnector; // para mapear conectores x ubicación
public:
	Connector(Component* father, bool isEntrada, unsigned xRel, unsigned yRel, unsigned exitNumber = 0, unsigned int idConector = 0);
	virtual ~Connector();

	unsigned int getIdParaMapeoDeConectores() {
		return m_idConnector;
	}

	void setIdParaMapeoDeConectores(unsigned int id) {
		m_idConnector = id;
	}

	unsigned getXRel() const
    {
        return m_xRel;
    }

    unsigned getYRel() const
    {
        return m_yRel;
    }

	void setXRel( unsigned x)
    {
        m_xRel = x;
    }

    void setYRel(unsigned y)
    {
        m_yRel = y;
    }

    Via* getVia() const
    {
        return m_via;
    }

    void setVia(Via *via)
    {
        m_via = via;
    }

    Component *getFather() const
    {
        return m_father;
    }

    bool isEntry() const
    {
        return m_isEntry;
    }

    void setOrientation(enum Orientation o)
    {
        m_orientation = o;
    }

    enum Orientation getOrientation() const
    {
        return m_orientation;
    }

};

#endif /* CONNECTOR_H_ */
